package com.xhwl.centiotdata.pushtrigger.alarm;

import com.xhwl.centiotdata.handler.alarm.impl.HaiKangReceiveHandler;
import com.xhwl.common.pojo.ResultJson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Leon
 * @Description: TODO
 * @Date: 2022/5/9 14:22
 */
@Slf4j
@RequestMapping("/")
@RestController
public class HaiKangReceiveController {

    @Autowired
    HaiKangReceiveHandler haiKangReceiveHandler;

    @PostMapping("/alarm-receive/haiKang-receive/{projectId}")
    public ResultJson haiKangReceive(@RequestBody String haiKangReceiveContent,
                                     @PathVariable("projectId") Integer projectId) {
        return haiKangReceiveHandler.haiKangReceive(haiKangReceiveContent, projectId);
    }

    @PostMapping("/alarm-receive/haiKang-receive/config/{rowId}")
    public ResultJson haiKangReceiveConfig(@RequestBody String haiKangReceiveContent,
                                     @PathVariable("rowId") Integer rowId) {
        return haiKangReceiveHandler.haiKangReceiveConfig(haiKangReceiveContent, rowId);
    }
}
